import hyRequest from '@/service'
import type { IAccount } from '@/types'
export function loginIntoRuoYi(data: IAccount) {
  const rData = { username: data.username, password: data.password }
  return hyRequest.post({ url: '/login', data: rData })
}
// 管理员登录
export function login4Admin(data: IAccount) {
  return hyRequest.post({ url: '/admin/Login4Cms', data })
}
// 用户登录
export function login4User(data: IAccount) {
  return hyRequest.post({ url: '/users/login', data })
}

// 获取用户信息
export function getUserInfo(id: number) {
  return hyRequest.get({ url: '/user/GetUserById/' + id })
}

// 获取用户菜单
export function getMenusByUserId(id: number) {
  return hyRequest.get({ url: '/menus/getMenusByUserId/' + id })
}
